﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CalWage.aspx.cs" Inherits="Admin_CalWage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
       <div>
            <div>
            你好！
            <asp:Button ID="btnGEmployee" runat="server" Text="管理员工" /><asp:Button ID="btnGWage" runat="server" Text="管理工资" /><asp:Button ID="btnGUser" runat="server" Text="管理用户" />
                <asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
                
            </div>
        
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="w_Id" DataSourceID="SqlDataSource2" OnSelectedIndexChanged="GridView1_SelectedIndexChanged1">
            <Columns>
                <asp:BoundField DataField="e_Id" HeaderText="员工编号"  SortExpression="e_Id" />
                <asp:BoundField DataField="w_Id" HeaderText="工资编号" SortExpression="w_Id" />
                <asp:BoundField DataField="w_Bw" HeaderText="基本工资" SortExpression="w_Bw" />
                <asp:BoundField DataField="d_Id" HeaderText="职务编号" SortExpression="d_Id" />
                <asp:BoundField DataField="w_Gw" HeaderText="总工资" SortExpression="w_Gw" />
                <asp:CommandField HeaderText="修改" ShowEditButton="True"/>
            </Columns>
        </asp:GridView>
    </div>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:pmsConnectionString %>" 
            DeleteCommand="DELETE FROM [Wage] WHERE ([e_Id] = @e_Id)"        
            SelectCommand="SELECT * FROM [Wage]"
            InsertCommand="INSERT INTO [Wage] ( [w_Id],[w_Bw], [d_Id], [w_Gw], [e_Id]) VALUES (@w_Id, @w_Bw, @d_Id, @w_Gw, @e_Id )"
            UpdateCommand="UPDATE [Wage] SET [w_Id] = @w_Id, [w_Bw] = @w_Bw ,[d_Id] = @d_Id, [w_Gw] = @w_Gw, [e_Id] = @e_Id WHERE [e_Id] = @e_Id">
            <SelectParameters>
                <asp:SessionParameter Name="e_Id" Type="String" />
            </SelectParameters>
           
            <DeleteParameters>
                <asp:SessionParameter Name="w_Id" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="w_Id" Type="String" />
                <asp:Parameter Name="w_Bw" Type="String" />
                <asp:Parameter Name="d_Id" Type="String" />
                <asp:Parameter Name="w_Gw" Type="String" />
                <asp:Parameter Name="e_Id" Type="String" />                
            </InsertParameters>
            <UpdateParameters>        
               <asp:Parameter Name="w_Id" Type="String" />
                <asp:Parameter Name="w_Bw" Type="String" />
                <asp:Parameter Name="d_Id" Type="String" />
                <asp:Parameter Name="w_Gw" Type="String" />
                <asp:Parameter Name="e_Id" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
        
        <br />
        <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="添加" />
        
    </form>
</body>
</html>
